﻿using InnoWeb.CEND.Core.Model.Blog;
using InnoWeb.CEND.Data.Mapping.BaseMapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InnoWeb.CEND.Data.Mapping.Blog
{
    public class BlogContentMapping : BaseMappingConfiguration<BlogContent, int>
    {
        public BlogContentMapping()
        {
            this.Property(a => a.Text).IsRequired().HasMaxLength(300);
            this.Property(a => a.TextTR).IsRequired().HasMaxLength(300);
            this.Property(a => a.VideoUrl).IsOptional();

            this.Property(a => a.BlogItemId);
            this.HasRequired(a => a.BlogItem).WithMany(a => a.BlogContents).HasForeignKey(a => a.BlogItemId);

        }
    }
}
